perm filename PROB4.PUB[LSP,JRA]13 blob
sn#305706 filedate 1977-09-13 generic text, type C, neo UTF8
COMMENT ⊗ VALID 00002 PAGES
C REC PAGE DESCRIPTION
C00001 00001
C00002 00002 .CENT(Problems involving list-notation)
C00004 ENDMK
C⊗;
.CENT(Problems involving list-notation)
.NL
.BEGIN CENTERIT;
1.##Discuss ←%3cons[%9α%41%3;cons[%9α%42%3;%9α%43%3]]%1
as opposed to ←%3cons[%9α%41%3;cons[%9α%42%3;#cons[%9α%43%3; NIL]]]%1
as a representation for %3(%9α%41%3, %9α%42%3, %9α%43%3)%1
.END
.P12:
.BEGIN CENTERIT;SELECT 1;
.GROUP
.P65:
.PT18;
2.##Translate the following lists into S-expr dotted-pair notation.
←%2a.%3 (A B C) %2b.%3 (A) %2c.%3 ((A)) %2d.%3 (A (B (C))) %2e.%3 (NIL)
.APART
.GROUP
%1
.pt2;
.ONCE FILL
Now go the other way and translate the following S-exprs into list notation.
.PT2
←%2f.%3 ((A . (B . NIL)) . ((C . NIL) . NIL)) %2g.%3 (NIL . NIL)
.pt2
←%2h.%3 (CONS . ((QUOTE . (A . NIL)) . NIL))
.pt18
.APART
.GROUP
%1
3.##Evaluate the following:
←%2a.%3 first[(A B)] %2b.%3 rest[(A B)]
←%2c.%3 concat[A;(B C)] %2d.%3 concat[A;NIL]
←%2e.%3 concat[eq[A;A];(A B C)] %2f.%3 first[rest[(A B)]]
.APART
.END